package ThreeSixZero;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/9/24
 * @project AutumnOffer
 * @description
 **/
public class Solution2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        while(!str.isEmpty()){
            String[] s = str.split(" ");
            int a = Integer.parseInt(s[0]);
            int b = Integer.parseInt(s[1]);
            int k = Integer.parseInt(s[2]);
            int v = Integer.parseInt(s[3]);
            int sum = a/v;
            if(b<=k){
                if(sum <= b+1){
                    System.out.println(sum);
                }else{
                    System.out.println(sum-b);
                }
            }
        }
    }
}
